﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace ITTestingSystem.Domain.Entities
{
    /// <summary>
    /// Specifies the questions entity
    /// </summary>
    /// 
    public class Question
    {
        /// <summary>
        /// Returns the primary key for the entity in the database table
        /// </summary>
        /// 
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// Returns the questions text
        /// </summary>
        /// 
        [Required]
        public string Text { get; set; }

        /// <summary>
        /// Returns the unique identifier of the questions type
        /// </summary>
        /// 
        [Required]
        public int QuestionTypeId { get; set; }

        /// <summary>
        /// Returns the unique indentifier of the test with this question
        /// </summary>
        /// 
        [Required]
        public int TestId { get; set; }

        /// <summary>
        /// Returns the points that can be obtained
        /// </summary>
        /// 
        [Required]
        public int PointsNumber { get; set; }




        /// <summary>
        /// Returns the questions type entity
        /// </summary>
        /// 
        public virtual QuestionType QuestionType { get; set; }

        /// <summary>
        /// Returns the tests entity with this question
        /// </summary>
        /// 
        public virtual Test Test { get; set; }

        /// <summary>
        /// Returns the answers to this question
        /// </summary>
        /// 
        public virtual ICollection<Answer> Answers { get; set; }
    }
}
